/**
 * resource2 - end condition, food gathered (med)
 */
package conditions;
import javax.swing.JOptionPane;

import main.*;
public class Resource2 extends Condition{

	/**
	 * constructor
	 * @param o - owner player
	 */
	public Resource2(Player o) {
		super(o, 2);
		}
	
	/**
	 * check if condition is reached
	 * returns true if complete, false otherwise
	 */
	public boolean checkComplete(){
		if(Owner.getRes().getFood()+Owner.getRes().getMetal()+Owner.getRes().getWood()>=700 && !isComplete()){
			this.complete();
			return true;
		}
		else
			return false;
			
	}
	public void complete(){
		complete=true;
		Owner.getRes().getScore().AddToScore(pointvalue);
		JOptionPane.showMessageDialog(null, ("Good farmer. YOU WIN"));
		}

}
